import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/index",
    name: "index",
    component: () => import("../views/Index.vue"),
    children: [
      {
        path: "/users",
        name: "users",
        component: () => import("../views/users.vue"),
      },
      {
        path: "/shopcar",
        name: "shopcar",
        component: () => import("../views/shopcar.vue"),
      },
      {
        path: "/detail",
        name: "detail",
        component: () => import("../views/detail.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
